package com.cheng.service.base.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cheng.dao.TaketimeDao;
import com.cheng.domain.base.TakeTime;
import com.cheng.service.base.TaketimeService;

@Service
@Transactional
public class TaketimeServiceImpl implements TaketimeService {
	
	@Autowired
	private TaketimeDao taketimeDao;

	@Override
	public List<TakeTime> getAllTaketime() {
		return taketimeDao.findAll();
	}

	@Override
	public void saveTaketime(TakeTime model) {
		taketimeDao.save(model);
	}

	@Override
	public void delteTaketime(Integer id) {
		taketimeDao.delete(id);
	}

	@Override
	public void cancelTaketime(Integer id) {
		taketimeDao.cancelTaketime(id);
	}

	@Override
	public void restoreTaketime(Integer id) {
		taketimeDao.restoreTaketime(id);		
	}

	@Override
	public Page<TakeTime> getTaketimePage(Pageable pageable) {
		return taketimeDao.findAll(pageable);
	}

}
